<?php require_once LAYOUTPATH.'layout_header.php'; ?>

<h1><?php echo $page_title; ?></h1>

<div id="bricabox_tabs" class="admin">
	<ul>
		<li class="back"><a href="/">&lsaquo; Back to your BricaBox</a></li>
		<?php render_tabs($admin_tabs); ?>
	</ul>
</div>

<table>
	<thead>
		<tr>
			<td>Entry</td>
			<td># of times flagged</td>
			<td>Actions</td>
		</tr>
	</thead>
	<tbody>
		<?php $flags = $this->Content_model->load_all_flagged($BBX['bricabox']->id); ?>
		<?php if ($flags): ?>
		<?php foreach ($flags->result() as $row): ?>
		<tr class="<?php echo alternator('even', 'odd'); ?>">
			<td><a href="<?php echo content_url($row); ?>"><?php echo $row->field1_value; ?></a></td>
			<td><?php echo $row->flag_count; ?></td>
			<td>
				<a href="/admin/remove_flags/<?php echo $row->content_id; ?>" class="delete" title="Remove flags" onclick="return confirm('Are you sure?');">
					<img src="/assets/images/icons/cross.png" alt="Delete" />
					Remove flags
				</a>
				
				<a style="margin-left: 10px;"
				class="delete" title="Delete entry" href="/content/<?php echo $row->content_id; ?>/destroy" onclick="return confirm('Are you sure? THIS IS PERMANENT AND CANNOT BE UNDONE.');">
					<img src="/assets/images/icons/cross.png" alt="Delete" />
					<span style="color:#900 !important;">Remove entry</span>
				</a>
			</td>
		</tr>
		<?php endforeach; ?>
		<?php endif; ?>
	</tbody>
</table>

<?php require_once LAYOUTPATH.'layout_footer.php'; ?>